import React from 'react'
import {PolygonUtil} from "../../../util/PolygonUtil"
import {BaseNodeWidget} from "./base/BaseNodeWidget";

export class TestBaseNode extends BaseNodeWidget {
  static defaultProps = {
    node: null,
    text: "Process",
    width: 100,
    height: 50,
    color: '#63c2de',
    strokeWidth: '1',
  };

  createShape (props) {
    const {node, displayOnly, color: displayColor} = props
    const {name, color} = node
    const style = {}
    if (color || displayColor) {
      style.background = color || displayColor
    }

    const polygonProps = {
      width : props.width,
      height : props.height,
      color : props.color,
      strokeWidth : props.strokeWidth,
      stroke: props.stroke,
    }
    return PolygonUtil.createRoundedRectangle(polygonProps)
  };


}

export const TestBaseNodeFactory = React.createFactory(TestBaseNode)
